﻿using System.Collections.Generic;
using System.Linq;

namespace Project5188.BUS
{
    public class Paging<T>
    {
        public int PageNo { get; set; }

        public int RecordCount { get; set; }

        public List<T> DataList { get; private set; }

        public List<T> GetDataList()
        {
            return DataList.Skip((PageNo - 1) * RecordCount).Take(RecordCount).ToList();
        }

        public Paging(List<T> dataSource, int pageNo, int recordCount)
        {
            DataList = dataSource;
            PageNo = pageNo;
            RecordCount = recordCount;
        }
    }
}
